//
//  CantripStaticSplitView.m
//  CantripSDK
//
//  Created by James Callender on Sun Jul 14 2002.
//  Copyright (c) 2002 James Callender. All rights reserved.
//

#import "CantripStaticSplitView.h"


@implementation CantripStaticSplitView

- (id)initWithFrame:(NSRect)frame 
{
    if (self = [super initWithFrame:frame])
	{
		viewIndex = 0;
		dividerThickness = [super dividerThickness];
	}
	
	return self;
}

- (void)setStaticIndex:(int)i
{
	viewIndex = i;
}

- (void)setDividerThickness:(float)t
{
	dividerThickness = t;
}

- (float)dividerThickness
{
	//return dividerThickness;
	return [super dividerThickness];
}

- (void)setSmallDivider:(BOOL)sm
{
	isSmallDivider = sm;
}

- (BOOL)isSmallDivider
{
	return isSmallDivider;
}

- (void) resizeSubviewsWithOldSize: (NSSize) size;
{
	float delta = [self frame].size.height - size.height;
	id v0 = [[self subviews] objectAtIndex: viewIndex];
	NSRect f0 = [v0 frame];
	
	f0.size.height += delta;
	[v0 setFrame: f0];
	
	[super resizeSubviewsWithOldSize: size];
}

- (void)drawDividerInRect:(NSRect)aRect
{
	if (isSmallDivider)
	{
		aRect.size.height = 5;
		[[NSColor cyanColor] set];
		NSRectFill(aRect);
		[[NSColor blueColor] set];
		NSFrameRect(aRect);
	}
	else [super drawDividerInRect:aRect];
}

@end
